package main

import (
	"database/sql"
	"fmt"
	"github.com/yourusername/gox/pkg/runtime"
)

func TestNested(db *sql.DB) {
	query := func() *runtime.Query {
		__gox_sql_0_builder := runtime.NewQueryBuilder()
		__gox_sql_0_builder.AddText("SELECT * FROM users WHERE id =")
		if __result := func() (__result interface{}) {
			return func() *runtime.Query {
				__nested_sql_0_builder := runtime.NewQueryBuilder()
				__nested_sql_0_builder.AddText("SELECT 1")
				__nested_sql_0 := __nested_sql_0_builder.Build()
				return __nested_sql_0
			}()
			return __result
		}(); __result != nil {
			__gox_sql_0_builder.AddText(fmt.Sprintf("%v", __result))
		}
		__gox_sql_0 := __gox_sql_0_builder.Build()
		return __gox_sql_0
	}()

	fmt.Println(query.String())
}

func main() {
	fmt.Println("Test nested SQL")
}
